<template>
    <div class="big-box">
        <div class="header">
            <img src="../../../../../assets/bigScreen/header2.png" alt="" />
            <div class="backBox" @click="goBack"></div>
        </div>
        <div class="backToBox">
            <div class="backTo" @click="gotoHome">
                <div>返回总窗口</div>
            </div>
            <div class="backTo" @click="backToOne">
                <div>返回上一页</div>
            </div>
        </div>
        <div class="centerBox">
            <div class="sreenTitle">{{ route.query.name }}</div>
            <div class="center">
                <div class="incubation">
                    <div class="policy">
                        <div @click="toDetail(item.id)" class="policy-box" v-for="item in dataList" :key="item">
                            <div class="title">{{item.title}}</div>
                            <div class="time">{{item.closingDate}}</div>
                        </div>
                        <no-data v-if="dataList.length==0" />
                    </div>
                    <div style="text-align: center;">
                        <a-pagination @change="onChange" :showSizeChanger="false" v-model:current="current" v-model:pageSize="pageSize" :total="total" show-less-items />
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
import { ref, onMounted, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { proofOfConceptList } from '../../../../../api/incubation'
const router = useRouter()
const pageAct = ref(1)
const dates = ref('')
const route = useRoute()

const dataList = ref([])
const current = ref(1)
const pageSize = ref(5)
const total = ref(0)

const getList = function () {
    proofOfConceptList({
        size:pageSize.value,
        number:current.value
    }).then(res=>{
        dataList.value = res.data.list
        total.value = res.data.total
    })
} 

watch(current,(e)=>{
    getList()
})

const toDetail = (id) => {
    router.push({
        path: '/bigScreen/conceptDetail',
        query: {
            id
        }
    })
}

//判断时间是否为个位数，如果时间为个位数就在时间之前补上一个“0”
const check = (val) => {
    if (val < 10) {
        return '0' + val
    } else {
        return val
    }
}

const gotoScreen = (act) => {
    router.push({
        path: '/bigScreen',
        query: {
            act: act,
        },
    })
}
const gotoHome = (act) => {
    router.push({
        path: '/bigScreenIndex',
    })
}
const backToOne = (act) => {
    router.go(-1)
}

const goBack = () => {
    router.push('/chart')
}
// gotoHome() {
//             router.push({
//                 path: '/bigScreenIndex',
//             })
//         },
//         backToOne() {
//             router.go(-1)
//         },

const displayTime = () => {
    //获取系统当前的年、月、日、小时、分钟、毫秒
    let date = new Date()
    let year = date.getFullYear()
    let month = date.getMonth() + 1
    let day = date.getDate()
    let hour = date.getHours()
    let minutes = date.getMinutes()
    let seconds = date.getSeconds()
    dates.value = `${year}年${month}月${day}日 ${check(hour)}:${check(minutes)}:${check(seconds)}`
}
//每隔1秒调用一次displayTime函数
const start = () => {
    setInterval(() => {
        displayTime()
    }, 1000) //单位是毫秒
}
onMounted(() => {
    start()
    getList()
})
</script>

<style scoped lang="scss">
@font-face {
    font-family: "ffa";
    src: url(../../../assets/bigScreen/fonts/DS-DIGIB.TTF);
}
ul,
li {
    list-style: none;
}
.big-box {
    background-color: #071c3b;
    height: 100vh;
}
.header {
    position: relative;
    text-align: center;
    position: relative;
    height: 19.1rem;

    .backBox {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 70rem;
        height: 10rem;
        cursor: pointer;
    }

    > img {
        width: 100%;
        max-height: 100%;
        margin-top: -1.1rem;
        image-rendering: -moz-crisp-edges; /* Firefox */
        image-rendering: -o-crisp-edges; /* Opera */
        image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
        image-rendering: crisp-edges;
        -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
    }
}

::v-deep {
    .ant-btn-primary {
        border-color: #037AFF;
        background: #037AFF;
    }

    .ant-input {
        background: rgba(68, 148, 255, 0.12);
        border: none;
        color: #FFFFFF;
    }

    .ant-pagination-item {
        background: rgba(8, 26, 48, 0.8);
        border: 1px solid #0B2F5F;
    }

    .ant-pagination-item a {
        color: #FFFFFF;
    }

    .ant-pagination-prev .ant-pagination-item-link,
    .ant-pagination-next .ant-pagination-item-link {
        background: rgba(8, 26, 48, 0.8);
        border: 1px solid #0B2F5F;
        color: #707981;
    }

    .ant-pagination-disabled .ant-pagination-item-link {
        background: rgba(8, 26, 48, 0.8);
        border: 1px solid #0B2F5F;
        color: #707981;
    }

    .ant-pagination-item-active {
        background: #004DFD;
        border-radius: 2px;
        border: none;
    }

    .ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-ellipsis, 
    .ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-ellipsis {
        color: #FFFFFF;
    }
}
.centerBox {
    width: 96%;
    margin: 0 auto;
    position: absolute;
    top: 14rem;
    left: 2%;
    .sreenTitle {
        background-image: url("../../../../../assets/bigScreen/sreenTitle.png");
        background-size: 100% 100%;
        height: 3.8rem;
        padding-left: 35px;
        font-weight: 600;
        color: #fff;
        display: flex;
        align-items: center;
    }
    .center {
        margin-top: 1rem;
        height: calc(100vh - 20rem);
        border: 1px solid;
        border-image: linear-gradient(
                130deg,
                #2385df 0%,
                rgba(35, 133, 223, 0.65) 92%
            )
            1;
    }
}
.backToBox {
    position: absolute;
    top: 8rem;
    right: 2%;
    display: flex;
    .backTo {
        background-image: url("../../../../../assets/bigScreen/backTo.png");
        color: #2dccff;
        background-size: 100% 100%;
        width: fit-content;
        padding: 2px 40px 10px 10px;
        font-weight: 600;
        cursor: pointer;
        margin-left: 10px;
        div {
            padding-top: 5px;
        }
    }
}
.incubation {
    position: relative;
    padding-bottom: 10rem;
   width: 140rem;
   margin: 0 auto;
   .title{
        display: flex;
        align-items: center;
        font-size: 3rem;
        margin: 3.5rem 0;
   }
   .protect{
    display: flex;
    justify-content: space-between;
    img{
        width: 66.7rem;
        height: 21.9rem;
    }
   }
}
.policy{
    // display: flex;
    // justify-content: space-between;
    // flex-wrap: wrap;
    padding: 6rem 0;
    .policy-box{
        border-bottom: 1px solid #1F75C7;
        margin-bottom:1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        cursor: pointer;
        .title{
            font-size: 1.6rem;
            font-weight: 700;
            margin: 3rem 0 2rem 0;
            letter-spacing: 0.2rem;
            color: #ffffff;
        }
        .time{
            color: #ffffff;
        }
    }
}
</style>
